<template>
  <div>App页面</div>
  <button @click="clickHandle">修改信息</button>
</template>

<script setup>
const appConfig = useAppConfig();
console.log(appConfig.title);
console.log(appConfig.theme);
console.log(appConfig.foo);

const clickHandle = () => {
  const newAppConfig = {
    title: "这是一个Nuxt应用2222",
    theme: {
      dark: false,
      colors: {
        primary: "red",
      },
    },
    foo: "zhangsan",
  };
  updateAppConfig(newAppConfig);

  console.log(appConfig.title);
  console.log(appConfig.theme);
  console.log(appConfig.foo);
};

const config = useRuntimeConfig();
console.log(config.apiSecret);
console.log(config.public.apiBase);
</script>
